﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Collections;

namespace DAO
{
    public class FAQ_DAO
    {
        private static QLTDTVDataContext dt = new QLTDTVDataContext();
        public static IEnumerable LayTatCaChuyenMuc()
        {
            return dt.spLayTatCaChuyenMuc().AsEnumerable();
        }

        public static IEnumerable LayThongTinCauHoiTheoMaChuyenMuc(int maChuyenMuc)
        {
            return dt.spLayThongTinCauHoiTheoMaChuyenMuc(maChuyenMuc).AsEnumerable();
        }

        public static string LayCauTraLoi(int maChuyenMuc,int maCauHoi)
        {
            var noiDungResult = dt.spLayCauTraLoi(maChuyenMuc,maCauHoi);

            string noiDung = "";
            foreach (var item in noiDungResult)
            {
                noiDung = item.NoiDung;
            }

            return noiDung;
        }
    }
}
